package org.zjx.common.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.zjx.account.enums.Sects;
import org.zjx.common.entity.Address;
import org.zjx.common.entity.Quest;
import org.zjx.prop.domain.model.ItemInstance;
import org.zjx.route.entity.Location;

import java.io.Serializable;
import java.util.List;

@Data
@NoArgsConstructor
public class RouteProperties implements Serializable {
    private static final long serialVersionUID = 1L;
    private long version; //道具缓存数据版本（没有变化（单组东西没用完/没有买新东西）无需更改）

    private String playerId;
    private Sects sects;

    private int hp;
    private int mp;

    private Address startAddress;
    private Address endAddress;

    private List<ItemInstance> inventoryInstances;  //背包实例
    private List<ItemInstance> extendedInstances;   //行囊实例
    private boolean inTeam;
    private boolean inBattle;
    private long syxTime;


    private List<Quest> queues;

    @JsonIgnore
    public Location getLocation(Address address) {
        return new Location(address.getCity(),address.getX(),address.getY());
    }
}
